<template name="Navber">
	
	
	<view>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="index">
				<view class="iconfont  margin-xs text-lg" :class="PageCur=='index'?'text-'+theme:'text-gray'">
					<!-- ../../static/sy_s.png -->
					<image src="../../static/red-new/fl_s.png" style="width: 20px;height: 20px;"></image>
				</view>
				<view :class="PageCur=='index'?'text-'+theme:'text-gray'">首页</view>
			</view>
			<!-- <view class="action" @click="NavChange" data-cur="category">
				<view class="iconfont  margin-xs text-lg" :class="PageCur=='category'?'text-'+theme:'text-gray'">
					<image src="../../static/fl_s.png" style="width: 20px;height: 20px;"></image>
				</view>
				<view :class="PageCur=='category'?'text-'+theme:'text-gray'">套餐列表</view>
			</view> -->
			<view class="action" @click="NavChange" data-cur="signin">
				
				<view class="iconfont margin-xs text-lg" :class="PageCur=='signin'?'text-'+theme:'text-gray'">
					<image src="../../static/red-new/kf2.png" style="width: 20px;height: 20px;"></image>
				</view>
				<view :class="PageCur=='signin'?'text-'+theme:'text-gray'">商城</view>
			</view>
			<view class="action" @click="NavChange" data-cur="order_sell">
				<view class="iconfont margin-xs text-lg" :class="PageCur=='order_sell'?'text-'+theme:'text-gray'">
					<image src="../../static/red-new/ser-6.png" style="width: 20px;height: 20px;"></image>
				</view>
				<view :class="PageCur=='order_sell'?'text-'+theme:'text-gray'">会员包</view>
			</view>
			<!-- <view class="action" @click="NavChange" data-cur="order_sell">
				<view class="iconfont margin-xs text-lg" :class="PageCur=='order_sell'?'text-'+theme:'text-gray'">
					
					<image src="../../static/red-new/ser-6.png" style="width: 20px;height: 20px;"></image>
				</view>
				<view :class="PageCur=='order_sell'?'text-'+theme:'text-gray'">预售</view>
			</view> -->
			<view class="action" @click="NavChange" data-cur="order_pay">
				<view class="iconfont margin-xs text-lg" :class="PageCur=='order_pay'?'text-'+theme:'text-gray'">
					<!-- ../../static/dd_s.png -->
					<image src="../../static/red-new/dd_s.png" style="width: 20px;height: 20px;"></image>
				</view>
				<view :class="PageCur=='order_pay'?'text-'+theme:'text-gray'">我的市场</view>
			</view>
			<!-- <view class="action" @click="NavChange" data-cur="order_pay">
				<view class="iconfont margin-xs text-lg" :class="PageCur=='order_pay'?'text-'+theme:'text-gray'">
					
					<image src="../../static/red/dd_s.png" style="width: 20px;height: 20px;"></image>
				</view>
				<view :class="PageCur=='order_pay'?'text-'+theme:'text-gray'">购物车</view>
			</view> -->
			<!-- <view class="action" @click="NavChange" data-cur="live">
				<view class="iconfont icon-zhibo margin-xs text-lg" :class="PageCur=='live'?'text-'+theme:'text-gray'"></view>
				<view :class="PageCur=='live'?'text-'+theme:'text-gray'">直播</view>
			</view> -->
			<!-- <view class="action" @click="NavChange" data-cur="channel_cate" v-if="hasShop">
				<view class='cuIcon-cu-image'>
					<image :src="CLOUDPATH+'/tabbar/jinhuo' + [PageCur == 'channel_cate'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='channel_cate'?'text-orange':'text-gray'">进货</view>
			</view> -->
			<!-- <view class="action add-action" @click="NavChange" data-cur="channel">
				<view class="iconfont icon-RectangleCopy  addview" :class="PageCur=='channel'?'text-'+theme:'text-gray'"></view>
				<view :class="PageCur=='channel'?'text-'+theme:'text-gray'">渠道中心</view>
			</view>
			<view class="action" @click="NavChange" data-cur="college" v-if="showCollege">
				<view class="iconfont icon-xueyuan margin-xs text-lg" :class="PageCur=='college'?'text-'+theme:'text-gray'"></view>
				<view :class="PageCur=='college'?'text-'+theme:'text-gray'">商学院</view>
			</view> -->
			<!-- <view class="action" @click="NavChange" data-cur="apply">
				<view class="iconfont icon-icon-test margin-xs text-lg" :class="PageCur=='apply'?'text-'+theme:'text-gray'"></view>
				<view :class="PageCur=='apply'?'text-'+theme:'text-gray'">报单</view>
			</view> -->
			<view class="action" @click="NavChange" data-cur="member">
				<view class="iconfont margin-xs text-lg" :class="PageCur=='member'?'text-'+theme:'text-gray'">
					<image src="../../static/red-new/me_s.png" style="width: 20px;height: 20px;"></image>
				</view>
				<view :class="PageCur=='member'?'text-'+theme:'text-gray'">我的</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	export default {
		name: "Navber",
		data() {
			return {
				module: [],
				loadConfig: true,
				loading: false,
				CLOUDPATH: this.$config.cloudPath,
				theme: this.$config.THEME(),
				theme_text: this.$config.THEME_TEXT(),
				showShopLive: this.$common.getCache('shop-live'),
				showCollege: this.$common.getCache('college'),
			}
		},
		props: {
			PageCur: {
				type: String,
				default: 'index'
			}
		},
		created: function(e) {
			this.$common.getConfig().then((response) => {
				this.module = response.module
				if(this.module && this.module.indexOf("shop-live") >= 0){
					this.showShopLive = true
					this.$common.setCache('shop-live', true)
				} else {
					this.showShopLive = false
					this.$common.setCache('shop-live', false)
				}
				if(this.module && this.module.indexOf("college") >= 0){
					this.showCollege = true
					this.$common.setCache('college', true)
				} else{
					this.showCollege = false
					this.$common.setCache('college', false)
				}
			})
			this.theme = this.$config.THEME()
		},
		updated: function(e) {
			this.theme = this.$config.THEME()
		},
		computed: mapState(['forcedLogin', 'hasLogin', 'channelLogin', 'member']),
		methods: {
			updateset() {
				this.theme = this.$config.THEME()
			},
			resendPage(url) {
				// #ifdef MP-WEIXIN
				uni.reLaunch({
					url: url
				})
				// #endif
				// #ifndef MP-WEIXIN
				uni.navigateTo({
					url: url
				})
				// #endif
			},
			NavChange: function(e) {
				this.theme = this.$config.THEME()
				var PageCur = e.currentTarget.dataset.cur
				if (PageCur == 'index') {
					this.resendPage("/pages/shop/index")
				} else if (PageCur == 'category') {
					this.resendPage("/pages/shop/whole_list")
				} else if (PageCur == 'signin') {
					this.resendPage("/pages/member/signin")
				} else if (PageCur == 'order_pay') {
					// this.resendPage("/pages/shop/cart/index")
					this.resendPage("/pages/member/team/index")
				}else if (PageCur == 'order_sell') {
					// this.resendPage("/pages/shop/vip_list")
					this.resendPage("/pages/shop/member_list")
				}else if (PageCur == 'live') {
					this.resendPage("/pages/shop/marketing/auction/index")
				} else if (PageCur == 'channel_cate') {
					this.resendPage("/pages/shop/category_channel")
				} else if (PageCur == 'apply') {
					this.resendPage("/pages/apply/apply")
				} else if (PageCur == 'member') {
					this.resendPage("/pages/member/index")
				} else if (PageCur == 'college') {
					this.resendPage("/collegePackages/pages/college/index")
				} else if (PageCur == 'channel') {
					this.resendPage("/pages/channel/index")
				}
			}
		}
	}
</script>

<style>
	.text-orange {
		color: #fbb240;
	}

	.addview {
		position: absolute;
		width: 35px;
		z-index: 2;
		height: 35px;
		border-radius: 50%;
		line-height: 35px;
		font-size: 25px;
		top: -17px;
		left: 0;
		right: 0;
		margin: auto;
		padding: 0;
	}
	.cu-bar.tabbar .action{
		background: none!important;
	}
</style>
